int maxNumber = 10;

ArrayList points;

PVector dest = new PVector();

void setup() {
  
  points = new ArrayList();
  
  dest.x = 0;
  dest.y = 0;
  
  //inicialice the arraylist points...
  for (int i = 0; i <= maxNumber; i++) {
    
    PVector vector = new PVector ();
    
    vector.x = random(0, width);
    vector.y = random(0, height);
    
    Point p = new Point (vector);
    
    p.setEndPoint(dest);
    
    //we added the point ...
    points.add(p);
    
  }
}

void draw() {
  
  background(255);
  
  dest.x = mouseX;
  dest.y = mouseY;
  
  for (int i = 0; i <= maxNumber; i++) {
    
    Point p = (Point) points.get(i);
    
    //pregunto si ya alcancé el punto..
    if(p.goaldReached()){
      p.setEndPoint(p.getStartPoint());
    }
    
    p.draw();
    
  }
  
}

